<template>
  <el-dialog :model-value="visible" :title="name" @closed="closed" :close-on-click-modal="false" :close-on-press-escape="false">
    <slot name="main"></slot>
    <el-collapse v-model="activeName" accordion>
      <el-collapse-item name="1">
        <template #title>
          <div style="width: 100%;margin-left: 80px">
            更多
          </div>
        </template>
        <slot name="more"></slot>
      </el-collapse-item>
    </el-collapse>
    <template #footer>
      <el-button @click="closed" type="primary">{{ $t("close") }}</el-button>
    </template>
  </el-dialog>
</template>

<script lang="ts">
import {defineComponent, toRefs} from "vue";
export default defineComponent({
  props: {
    name: String,
    visible: Boolean,
  },
  emits: ['close'],
  setup(props, context) {
    const closed = () => {
      context.emit('close')
    };
    let state = {
      visible: props.visible,
      name: props.name,
      activeName: "",
    }
    return {...toRefs(state), closed};
  },

  created() {

  },
  mounted() {

  },
  methods: {},
})
</script>

<style scoped>

</style>
